<?php include_partial('back/show', array('uri' => '@member_matchList?name_slug=' . $member_info[ 'slug' ])); ?>
<h1 class="title">Modifier ce match</h1>

<?php foreach($form as $field => $f): ?>
    <?php $attributes[$field] = array() ?>
<?php endforeach ?>

<?php if ($form->hasErrors()): ?>
    <?php foreach($form as $field => $f): ?>
      <?php if($f->hasError()): ?>
        <?php $attributes[$field] = array('class' => 'error') ?>
      <?php endif ?>
    <?php endforeach ?>
    <div class="box_relief red">Les champs sont incomplets et/ou invalides.</div>
<?php endif; ?>

<form method="post" name="<?php echo $form->getName()?>" action="<?php echo url_for($sf_request->getUri()) ?>">
    <table>
        <tr>
            <td></td>
            <td><?php echo $form['status']->renderError(); ?></td>
        </tr>
        <tr>
            <td><?php echo $form['status']->renderLabel('Victoire/Défaite* : ', $attributes['status']); ?></td>
            <td><?php echo $form['status']->render(); ?></td>
        </tr>
        <tr>
            <td></td>
            <td><?php echo $form['datetime_match']->renderError(); ?></td>
        </tr>
        <tr>
            <td><?php echo $form['datetime_match']->renderLabel('Date du match : ', $attributes['datetime_match']); ?></td>
            <td><?php echo $form['datetime_match']->render(); ?></td>
        </tr>
        <tr>
            <td></td>
            <td><?php echo $form['opponent_lastname']->renderError(); ?></td>
        </tr>
        <tr>
            <td><?php echo $form['opponent_lastname']->renderLabel('Nom : ', $attributes['opponent_lastname']); ?></td>
            <td><?php echo $form['opponent_lastname']->render(); ?></td>
        </tr>
        <tr>
            <td></td>
            <td><?php echo $form['opponent_firstname']->renderError(); ?></td>
        </tr>
        <tr>
            <td><?php echo $form['opponent_firstname']->renderLabel('Prénom : ', $attributes['opponent_firstname']); ?></td>
            <td><?php echo $form['opponent_firstname']->render(); ?></td>
        </tr>
        <tr>
            <td></td>
            <td><?php echo $form['opponent_point']->renderError(); ?></td>
        </tr>
        <tr>
            <td><?php echo $form['opponent_point']->renderLabel('Points* : ', $attributes['opponent_point']); ?></td>
            <td><?php echo $form['opponent_point']->render(); ?></td>
        </tr>
        <tr>
            <td></td>
            <td><?php echo $form['opponent_licensee_number']->renderError(); ?></td>
        </tr>
        <tr>
            <td><?php echo $form['opponent_licensee_number']->renderLabel('N° licence : ', $attributes['opponent_licensee_number']); ?></td>
            <td><?php echo $form['opponent_licensee_number']->render(); ?></td>
        </tr>
        <tr>
            <td></td>
            <td><?php echo $form['match_type_id']->renderError(); ?></td>
        </tr>
        <tr>
            <td><?php echo $form['match_type_id']->renderLabel('Type du match : ', $attributes['match_type_id']); ?></td>
            <td><?php echo $form['match_type_id']->render(); ?></td>
        </tr>
        <tr>
            <td colspan="2"><?php echo $form->renderHiddenFields(); ?></td>
        </tr>
    </table>
    <input type="submit" class="box_relief dark_blue" value="Valider" />
</form>
<p class="mandatoryInformations">(*) Informations obligatoires</p>